import Mock from 'mockjs';
// import assetsAuditJson from '../../data/audit/assetsAudit.json';


export default {
    className: "live.model.ChannelTurnDown",
    queryData: function(postData) {
        return Mock.mock({
            isSuccess: "Y",
            reason: "",
            message: [],
            "data": {
                "recordCount": 38,
                "pageCount": 1,
                "pageIndex": 1,
                "pageSize": 20,
                "queryResult|38": [{
                    "keyID|1000-9999": 1000,
                    "channelId": /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$/,
                    "channelName": Mock.mock('@ctitle'),//@title为英文版
                    "programCount": /^[0-9][0-9]$/,
                    "liveStartTime": Mock.mock('@now'),
                    "liveEndTime": Mock.mock('@now'),
                    "createTime": Mock.mock('@now'),
                    "lastUpdateTime": Mock.mock('@now'),
                    "lastUpdatedBy": Mock.mock('@ctitle'),
                    // "programDesc": Mock.mock('@ctitle'),
                    "status": "更新中",
                    "version": 1
                }],
                // "queryResult": assetsAuditJson
            }
        });
    },
    queryByKeyID: function(postData) {



        // var curFindObject = null;
        // for (var i = 0; i < assetsAuditJson.length; i++) {
        //     if (postData.keyID == assetsAuditJson[i].keyID) {
        //         curFindObject = assetsAuditJson[i];
        //         break;
        //     }
        // }
        // if (curFindObject == null) {
        //     return Mock.mock({
        //         isSuccess: "Y",
        //         reason: "",
        //         message: [],
        //         "data": {
        //             "keyID|1000-9999": 1000,
        //             "programId": /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$/,
        //             "programName": Mock.mock('@ctitle'),//@title为英文版
        //             "programCount": /^[0-9][0-9]$/,
        //             "startTime": Mock.mock('@now'),
        //             "endTime": Mock.mock('@now'),
        //             "programDesc": Mock.mock('@ctitle'),
        //             "status": Mock.mock('@ctitle'),
        //             "version": 1
        //         }
        //     });
        // } else {
        //     return {
        //         isSuccess: "Y",
        //         reason: "",
        //         message: [],
        //         data: curFindObject,
        //     };
        // }

        

        return Mock.mock({
            isSuccess: "Y",
            reason: "",
            message: [],
            "data": {
                "keyID|1000-9999": 1000,
                "programId": /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$/,
                "programName": Mock.mock('@ctitle'),//@title为英文版
                "programCount": /^[0-9][0-9]$/,
                "startTime": Mock.mock('@now'),
                "endTime": Mock.mock('@now'),
                "programDesc": Mock.mock('@ctitle'),
                "status": "更新中",
                "version": 1
            }
        });

    },
  
};
